From c6133116ca930902e39c5eb99c14b1624744ab45 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Tue, 21 Nov 2000 20:39:23 +0000 Subject: [PATCH] (Fkill_buffer): Notice if the buffer to kill is the sole visible buffer when we're currently in the mini-buffer, and give up if so. --- src/buffer.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/buffer.c b/src/buffer.c index 8c2deeb5bac..99815cb2d7d 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1236,6 +1236,17 @@ with SIGHUP.") return Qnil; } + /* Notice if the buffer to kill is the sole visible buffer + when we're currently in the mini-buffer, and give up if so. */ + XSETBUFFER (tem, current_buffer); + if (EQ (tem, XWINDOW (minibuf_window)->buffer)) + { + tem = Fother_buffer (buf, Qnil, Qnil); + Fset_buffer (tem); + if (EQ (buf, tem)) + return Qnil; + } + /* Now there is no question: we can kill the buffer. */ #ifdef CLASH_DETECTION -- 2.30.2